package org.hcyspartnoc.demo.common.core.enums;

import lombok.Getter;

@Getter
public enum CoreSysRole {
    SUPER_ADMIN(100000000, "超级管理员"), NORMAL_USER(100000001, "普通用户");
    final Integer id;
    final String name;

    CoreSysRole(Integer id, String name) {
        this.id = id;
        this.name = name;
    }

    public static CoreSysRole getById(Integer id) {
        for (CoreSysRole statusEnum : CoreSysRole.values()) {
            if (statusEnum.getId().equals(id)) {
                return statusEnum;
            }
        }
        return null;
    }
}
